LearningStore.CreateQuery Method

Create a new instance of the LearningStoreQuery class

Parent Type: LearningStore

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public LearningStoreQuery CreateQuery (
string viewName

)

Parameters

viewName

Name of the view for the query. If this is an item type name, then the default view for the item type is used.

Return Value

A new LearningStoreQuery

Exceptions
Exception type Condition
ArgumentNullException

viewName is a null reference.

InvalidOperationException

The store was created by a different version of this product, the schema information stored inside the database is invalid, or viewName does not refer to a view or item type in the store.

SqlException

The database could not be opened or other SQL error.

Remarks

See the LearningStoreQuery documentation for more information about constructing queries.

Example

The following code opens a store and creates a new query:

C#
LearningStore store = new LearningStore("Server=Learning;Database=Mls;Integrated Security=true", "Bob");
LearningStoreQuery query = store.CreateQuery("AttemptItem");